loongarch64: backport kernel BPF trampoline
authorVincent Li <[email protected]>
Sun, 7 Dec 2025 15:53:07 +0000 (07:53 -0800)
committerChristian Marangi <[email protected]>
Mon, 8 Dec 2025 17:52:19 +0000 (18:52 +0100)
commited5cefb037c2ba5b632d7dea5b8b004af53b51a9
tree8f4337c70a1d4ea23354b76f5dd7eb801f4c9a1a
parent301eee8099383053a13f22d9636f54b7ac932f03
loongarch64: backport kernel BPF trampoline

Enable xdp-loader to attach multiple XDP programs to a single interface by
backporting the BPF trampoline implementation from Linux kernel 6.17 to
6.12 for LoongArch64.

The xdp-loader utility relies on libxdp, which in turn requires kernel
support for BPF trampoline. While x86_64 and other architectures have
this feature, LoongArch64 only gained it in kernel 6.17. Without this
backport, xdp-loader fails on LoongArch64 systems running kernel 6.12.

Changes backported include:
- BPF trampoline infrastructure for LoongArch64
- Necessary JIT compiler updates
- Related BPF subsystem changes

This allows full compatibility with the xdp-tools ecosystem on LoongArch64
systems running older kernel versions.

Reference: https://github.com/xdp-project/xdp-tools/tree/main/lib/libxdp

Signed-off-by: Vincent Li <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/21077
Signed-off-by: Christian Marangi <[email protected]>
target/linux/loongarch64/patches-6.12/001-v6.17-LoongArch-Add-larch_insn_gen_beq_bne-helpers.patch [new file with mode: 0644]
target/linux/loongarch64/patches-6.12/002-v6.17-LoongArch-BPF-Update-the-code-to-rename-validate_code-to-validate_ctx.patch [new file with mode: 0644]
target/linux/loongarch64/patches-6.12/003-v6.17-loongArch-BPF-Add-dynamic-code-modification-support.patch [new file with mode: 0644]
target/linux/loongarch64/patches-6.12/004-v6.17-LoongArch-BPF-Add-basic-bpf-trampoline-support.patch [new file with mode: 0644]